﻿using GIMS.Def.Settings;
using GIMS.GUI.ArgumentControls;
using GIMS.GUI.GeneralConfig;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using GIMS.Def.Arguments;

namespace GIMS.GUI.Test
{
    /// <summary>
    ///This is a test class for ArgumentControlFactoryTest and is intended
    ///to contain all ArgumentControlFactoryTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ArgumentControlFactoryTest
    {
        /// <summary>
        /// Reset GlobalSettings
        /// </summary>
        [TestInitialize()]
        public void MyTestInitialize()
        {
            GlobalSettings_Accessor.instance = null;
        }

        /// <summary>
        ///A test for CreateConfigControl with an append argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForAppedTest()
        {
            Argument argument = new AppendArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(AppendArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a color argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForColorTest()
        {
            Argument argument = new ColorArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(ColorArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a geometry argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForGeometryTest()
        {
            Argument argument = new GeometryArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(GeometryArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a gravity argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForGravityTest()
        {
            Argument argument = new GravityArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(GravityArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a draw argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForNumberTest()
        {
            Argument argument = new NumberArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(NumberArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a path argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForPathTest()
        {
            Argument argument = new PathArgument(PathType.load);
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(PathArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a path argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForLiteralTest()
        {
            Argument argument = new LiteralArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(LiteralArgumentControl));
        }

        /// <summary>
        ///A test for CreateConfigControl with a path argument
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GIMS.GUI.exe")]
        public void CreateConfigControlForDrawTest()
        {
            Argument argument = new DrawArgument();
            var actual = ArgumentControlFactory.CreateConfigControl(argument);
            Assert.IsInstanceOfType(actual, typeof(DrawArgumentControl));
        }
    }
}
